<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/four.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../css/jqe/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../css/jqe/themes/icon.css"/>

    <script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>

    <script type="text/javascript">
    $(function(){
    	//初始化对话框
    	 $('#dw,#dwEdit').window({
    		   onBeforeClose:function(){ 
    			   //取消时关闭等待框
    			   setTimeout(function(){ 
    				   sending.style.visibility = "hidden";
				   }, 250);
    	   }});
    	
   
          $(".btnAll").each(function(i,v){
    	   //变手型
    	     $(v).mouseover(function() {
				$(this).css("cursor", "hand");
			 }).mouseout(function() {
				$(this).css("cursor", "pointer");
			 });
    	   
    	   
    	   if($(v).html()=='【新增】'){
    		   $(v).click(function(){
    			  location.href="toaddcst.do";
    		   });
    	   }else if($(v).html()=='【编辑】'){
      		   $(v).click(function(){
      			 location.href="toupcst.do?qid="+$(v).prop("lang");
      			  
      		   });
    	   }else if($(v).html()=='【删除】'){
    		   $(v).click(function(){
    			  if(confirm("确认删除'"+$(v).prop("title")+"'?")){
    				  location.href="delQtion.do?qid="+$(v).prop("lang"); 
    			  }
    		   });
    	   } 
       });
       
          $("#kcmdelid").change(function(){
        	var sbid = $("#kcmdelid").val();
        	 location.href="findBySome.do?sbid="+sbid;
          })
      
     
    });
    </script>
</head>
<body>
	<!-- 包含等待框 -->
	<jsp:include page="../waittable.jsp" flush="true" />
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr valign="top">
			<td bgcolor="#FFFFFF"><table width="96%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
					<tr align="left" bgcolor="#F2FDFF">			
						<td colspan="9" class="optiontitle">测试题管理
						<select name="kcmdelid" id="kcmdelid">
						<option value="">全部</option>
						<c:forEach items="${listcour}" var="lc">
						<option ${param.sbid==lc.kcmdelid?"selected='selected'":""}   value="${lc.kcmdelid}">${lc.kcmdelName}</option>
						</c:forEach>
						</select>
						</td>
						
					</tr> 
					<tr><td>一、选择题</td></tr>
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">题目</td>
						<td align="center" bgcolor="#ebf0f7">选项A</td>
						<td align="center" bgcolor="#ebf0f7">选项B</td>
						<td align="center" bgcolor="#ebf0f7">选项C</td>
						<td align="center" bgcolor="#ebf0f7">选项D</td>
						<td align="center" bgcolor="#ebf0f7">参考答案</td>
						<td align="center" bgcolor="#ebf0f7">难度等级</td>
						<td align="center" bgcolor="#ebf0f7">操作 <span class="btnAll">【新增】</span> </td>
					</tr>
					<c:forEach items="${page.results}" var="qt1">
					<c:if test="${qt1.questiontype==1}">
						<tr align="center" bgcolor="#FFFFFF">
						    <td align="center">${qt1.questionName}</td>
							<td align="center">${qt1.qselectA}</td>
							<td align="center">${qt1.qselectB}</td>
							<td align="center">${qt1.qselectC}</td>
							<td align="center">${qt1.qselectD}</td>
							<td align="center">${qt1.anws}</td>
							<td align="center">${qt1.hard}</td>
							<td align="center">												
									 <span class="btnAll" lang="${qt1.qid}">【编辑】</span>
								    | <span class="btnAll" lang="${qt1.qid}" title="${qt1.questionName}">【删除】</span>
				               
							</td>
						</tr>
						</c:if>
					</c:forEach>
					<tr><td>一、简题</td></tr>
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">题目</td>
						<td align="center" bgcolor="#ebf0f7" colspan="5">参考答案</td>
						<td align="center" bgcolor="#ebf0f7">难度等级</td>
						<td align="center" bgcolor="#ebf0f7">操作 <span class="btnAll">【新增】</span> </td>
					</tr>
					<c:forEach items="${page.results}" var="qt2">
					<c:if test="${qt2.questiontype==2}">
						<tr align="center" bgcolor="#FFFFFF">
						    <td align="center">${qt2.questionName}</td>
							<td align="center" colspan="5">${qt2.anws}</td>
							<td align="center">${qt2.hard}</td>
							<td align="center">												
									 <span class="btnAll" lang="${qt2.qid}">【编辑】</span>
								    |<span class="btnAll" lang="${qt2.qid}" title="${qt2.questionName}">【删除】</span>
				               
							</td>
						</tr>
						</c:if>
					</c:forEach>
					<tr align="right" bgcolor="#ebf0f7">
							<td colspan="8">
							<jk:page totalPage="${page.totalPage}" pageNo="${page.pageNo}" totalRecord="${page.totalRecord}"
                                url="findBySome.do?sbid=${sbid}"/>
							</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
		  <td align="center" style="color: red">${msg}</td>
		</tr>
	</table>
  
	<div id="dw" class="easyui-window" title="创建课程模块" data-options="modal:true,minimizable:false,closed:true,maximizable:false,iconCls:'icon-save'" style="width:300px;height:200px;padding:10px;display: none;">
		<form action="addKC.do" method="post">
		     课程模块名称：<input name="kcmdelName"/><br><br>
		     课程模块描述 ：<textarea name="kcmdelDesc" rows="3" cols="30"></textarea><br><br>
		      <input type="submit" value="保存"/><br>
		</form>
	</div>
	
	 <div id="dwEdit" class="easyui-window" title="修改课程模块" data-options="modal:true,minimizable:false,closed:true,maximizable:false,iconCls:'icon-save'" style="width:300px;height:200px;padding:10px;display: none;">
		<form action="upKC.do" method="post">
		<input name="kcmdelid" id="upd_kcmdelid" type="hidden"   />
		     课程模块名称：<input name="kcmdelName" id="upd_kcmdelName"   /><br><br>
		     课程模块描述 ：<textarea name="kcmdelDesc" rows="3" cols="30" id="upd_kcmdelDesc"></textarea><br><br>
		      <input type="submit" value="修改"/><br>
		</form>
	</div>
	
</body>
</html>